<?php
session_start();

if(!isset($_SESSION['id'])){
	header('Location:login.php');
}
   $arrayid=$_POST['arrayid'];
   $id=$_GET['typeid'];
   $connect=mysql_connect("localhost","root","");
   mysql_select_db("shenji",$connect);
   mysql_query("set names utf8");
	if(isset($arrayid[0])){
		 foreach ($arrayid as $id){
           $sql="delete from type where typeid=$id";
		   mysql_query($sql);
	    }
     }
   if(isset($id)){   
	   $sql="delete from type where typeid=$id";
	   mysql_query($sql);
   }
   
	echo "<script>location='select_xiangmu.php'</script>";
?>